<?php
    include 'init.php';

    //相册id
    $album_id = $_GET['album_id'];

    //图片id
    $id = $_GET['id'];

    //把当前id这个图片face设置为1
    $sql = "update photo set face='1' where album_id='$album_id' and id='$id'";
    mysql_query($sql);

    //把不是当前id的图片face设置为0
    $sql = "update photo set face='0' where album_id='$album_id' and id != '$id'";
    mysql_query($sql);

    redirect('设置成功','index.php?album_id='.$album_id);
